package etf.pia.entity;
// Generated Feb 13, 2014 1:21:45 AM by Hibernate Tools 3.6.0


import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Spiskovi generated by hbm2java
 */
@Entity
@Table(name="spiskovi"
    ,catalog="pia"
)
public class Spiskovi  implements java.io.Serializable {


     private Integer idSpiskovi;
     private Predmet predmet;
     private boolean zakljucan;
     private String naziv;
     private String termin;
     private String mesto;
     private int ogranicenje;
     private Set<Prijava> prijavas = new HashSet<Prijava>(0);

    public Spiskovi() {
    }

	
    public Spiskovi(Predmet predmet, boolean zakljucan, String naziv, String termin, String mesto, int ogranicenje) {
        this.predmet = predmet;
        this.zakljucan = zakljucan;
        this.naziv = naziv;
        this.termin = termin;
        this.mesto = mesto;
        this.ogranicenje = ogranicenje;
    }
    public Spiskovi(Predmet predmet, boolean zakljucan, String naziv, String termin, String mesto, int ogranicenje, Set<Prijava> prijavas) {
       this.predmet = predmet;
       this.zakljucan = zakljucan;
       this.naziv = naziv;
       this.termin = termin;
       this.mesto = mesto;
       this.ogranicenje = ogranicenje;
       this.prijavas = prijavas;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)

    
    @Column(name="id_spiskovi", unique=true, nullable=false)
    public Integer getIdSpiskovi() {
        return this.idSpiskovi;
    }
    
    public void setIdSpiskovi(Integer idSpiskovi) {
        this.idSpiskovi = idSpiskovi;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="predmet", nullable=false)
    public Predmet getPredmet() {
        return this.predmet;
    }
    
    public void setPredmet(Predmet predmet) {
        this.predmet = predmet;
    }

    
    @Column(name="zakljucan", nullable=false)
    public boolean isZakljucan() {
        return this.zakljucan;
    }
    
    public void setZakljucan(boolean zakljucan) {
        this.zakljucan = zakljucan;
    }

    
    @Column(name="naziv", nullable=false, length=45)
    public String getNaziv() {
        return this.naziv;
    }
    
    public void setNaziv(String naziv) {
        this.naziv = naziv;
    }

    
    @Column(name="termin", nullable=false, length=45)
    public String getTermin() {
        return this.termin;
    }
    
    public void setTermin(String termin) {
        this.termin = termin;
    }

    
    @Column(name="mesto", nullable=false, length=45)
    public String getMesto() {
        return this.mesto;
    }
    
    public void setMesto(String mesto) {
        this.mesto = mesto;
    }

    
    @Column(name="ogranicenje", nullable=false)
    public int getOgranicenje() {
        return this.ogranicenje;
    }
    
    public void setOgranicenje(int ogranicenje) {
        this.ogranicenje = ogranicenje;
    }

@ManyToMany(fetch=FetchType.LAZY)
    @JoinTable(name="spiskovi_prijava", catalog="pia", joinColumns = { 
        @JoinColumn(name="spiskovi", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="prijava", nullable=false, updatable=false) })
    public Set<Prijava> getPrijavas() {
        return this.prijavas;
    }
    
    public void setPrijavas(Set<Prijava> prijavas) {
        this.prijavas = prijavas;
    }




}


